import 'package:flutter/material.dart';

class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // return IconBadge(Icons.pool, color: Colors.pink, backgroundColor: Colors.grey[100]);
    return Container(
      color: Colors.white,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          IconBadge(Icons.pool, color: Colors.pink, backgroundColor: Colors.grey[100]),
          IconBadge(Icons.beach_access, color: Colors.lightBlue, backgroundColor: Colors.grey[200]),
          IconBadge(Icons.airplanemode_active, color: Colors.purpleAccent, backgroundColor: Colors.grey[100]),
        ],
      ),
    );
  }
}

class IconBadge extends StatelessWidget {
  final IconData icon;
  final double size;
  final Color color;
  final Color backgroundColor;

  IconBadge(this.icon, {
    this.size = 32.0,
    this.color = Colors.white,
    this.backgroundColor = Colors.white,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      color: backgroundColor,
      child: Icon(icon, size: size, color: color),
      width: size + 40.0,
      height: size + 40.0,
    );
  }
}
